<!DOCTYPE html>
{% load static %}
<html lang="zh-cms-hans">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <script src="{% static 'js/jquery.min.js' %}"></script>
        <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
        <link
            rel="stylesheet"
            type="text/css"
            href="{% static 'css/search_default.css' %}"
        />
        <link
            rel="stylesheet"
            type="text/css"
            href="{% static 'css/search_component.css' %}"
        />
        <script src="{% static 'js/search_modernizr.custom.js' %}"></script>
        
        <link rel="stylesheet" href="{% static 'css/user.css' %}" />
        {% block haed_files %}
        {% endblock haed_files %}
        <link rel="stylesheet" href="{% static 'css/footer.css' %}" />
        <title>{% block title %}用户中心{% endblock title %}</title>
    </head>
    <body>
        <div class="welcome">
            <div class="box">
                <p>欢迎来到A！</p>
                <ul>
                    {% if user.is_authenticated %}
                    <li>欢迎您 {{user.username}} </li>
                    <li><span>|</span></li>
                    <li><a href="{% url 'user:logout' %}">退出</a></li>
                    {% else %}
                    <li><a href="{% url 'user:login' %}">登录</a></li>
                    <li><span>|</span></li>
                    <li><a href="{% url 'user:register' %}">注册</a></li>
                    {% endif %}
                    <li><span>|</span></li>
                    <li><a href="{% url 'user:user' %}">用户中心</a></li>
                    <li><span>|</span></li>
                    <li><a href="{% url 'cart:cart' %}">我的购物车</a></li>
                    <li><span>|</span></li>
                    <li><a href="{% url 'user:user_order' %}">我的订单</a></li>
                </ul>
            </div>
        </div>
        <div class="search_mine">
            <div class="logo">
                <a href="{% url 'goods:index' %}"><img src="{% static 'logo.png' %}" alt="logo" /></a>
            </div>
            <div class="title_mine">
                {% block page_title %}用户中心{% endblock page_title %}
            </div>
            <div class="searchs">
                <div class="column">
                    <div id="sb-search" class="sb-search">
                        <form method="get" action="/search">
                            <input
                                class="sb-search-input"
                                placeholder="你想搜索什么呢？"
                                type="text"
                                value=""
                                name="q"
                                id="search"
                            />
                            <input
                                class="sb-search-submit"
                                type="submit"
                                value=""
                            />
                            <span class="sb-icon-search">
                                <img
                                    src="{% static 'image/搜索.png' %}"
                                    alt=""
                                />
                            </span>
                        </form>
                    </div>
                </div>
            </div>
            {% block index_cart %}{% endblock index_cart %}
        </div>
        {% block index_block %}
        <div class="main_mine">
            <div class="side_nav">
                <div>用户中心</div>
                <ul>
                    <li>
                        <a {% if page_name == 'center' %}class="active"{% endif %} href="{% url 'user:user' %}">个人信息</a>
                    </li>
                    <li>
                        <a {% if page_name == 'order' %}class="active"{% endif %} href="{% url 'user:user_order' %}">全部订单</a>
                    </li>
                    <li>
                        <a {% if page_name == 'site' %}class="active"{% endif %} href="{% url 'user:user_site' %}">收货地址</a>
                    </li>
                </ul>
            </div>
            <div class="contents">
                {% block contents%}
                <div class="content">
                        <div>基本信息</div>
                    <ul>
                        <li>用户名：{{user.username}}</li>
                        {% if user_default %}
                        <li>联系方式：{{user_default.phone}}</li>
                        <li>联系地址：{{user_default.addr}}</li>
                        {% else %}
                        <li>联系方式：无默认联系方式</li>
                        <li>联系地址：无默认联系地址</li>
                        {% endif %}
                    </ul>
                </div>
                <div class="explore">
                    <div>最近浏览</div>
                    <ul>
                        {% for good in goods %}
                        <li>
                            <a href="{% url 'goods:detail' good.id %}"
                                ><img
                                    src=" {{good.image.url}} "
                                    alt=""
                            /></a>
                            <a href="{% url 'goods:detail' good.id %}">{{good.name}}</a>
                            <div>
                                <span>￥{{good.price}}</span>
                                <p>{{good.price}}/{{good.unite}}</p>
                                <a href=""
                                    ><img
                                        src="{% static 'image/购物车.png' %}"
                                        alt="加入购物车"
                                /></a>
                            </div>
                        </li>
                        {% empty %}
                        <a href="{% url 'goods:index' %}">暂时没有任何浏览记录，去逛逛呗。</a>
                        {% endfor %}
                    </ul>
                </div>
                {% endblock contents%}
            </div>
        </div>
        {% endblock index_block %}
        <footer>
            <div class="line"></div>
            <ul>
                <li><a href="">关于我们</a></li>
                <li>|</li>
                <li><a href="">联系我们</a></li>
                <li>|</li>
                <li><a href="">招聘人才</a></li>
                <li>|</li>
                <li><a href="">友情链接</a></li>
            </ul>
            <p>CopyRight © 2016 A技术有限公司 All Rights Reserved</p>
            <p>电话：010-****888 京ICP备*******8号</p>
        </footer>
    </body>
<script src="{% static 'js/search_classie.js' %}"></script>
        <script src="{% static 'js/search_uisearch.js' %}"></script>
        <script>
            new UISearch(document.getElementById("sb-search"));
        </script>
        {% block bottom_file %}{% endblock bottom_file %}
</html>
